package main

import (
	"go-web-demo/packages/model"
	"log"
	"net/http"

	"github.com/gin-gonic/gin"
)

var engine *gin.Engine

func init() {
	engine = gin.Default()
	engine.LoadHTMLFiles("static/index.html")
}

func main() {

	engine.GET("/index", func(c *gin.Context) {
		s := model.NewStudent()
		s.Get()
		log.Println("ss===", s)
		c.HTML(http.StatusOK, "index.html", gin.H{
			"Name": s.Name,
		})
	})
	engine.Run(":8080")
}
